import { $post } from '@js/authRequest'

export async function submitRequest (data) {
  let url = '/api/arbitrator/task'
  if (data.taskid) {
    url = '/api/arbitrator/task/feedback'
  }
  const res = await $post(url, data)
  if (res.status !== 1) {
    throw new Error(res.message)
  }
  return res.data
}
